import {ref, onUnmounted} from 'vue'

export const useInterval = (callback, time) =>{
	let t = setInterval(callback,time)
	
	const close = () => {
		clearInterval(t)
	}
	onUnmounted(close)	
	return {
		close
	}
}